When data processing, it may be required to perform a division by a small non-power-of-two constant. Such division operations are commonly required in graphics processing. This may for example be the case when working with normalized numbers. An unsigned normalized number, sometimes referred to as unorm<n>, has a value in the range [0, 1] and the numerical value of a bit pattern x is
      x                  2        n            -      1        .For example for an unorm6, the formula is
      x    63    .The division by a small non-power-of-two constant may be required when multiplying two normalized values, or when converting to floating point or fixed-point values. One way to perform such a division is to multiply by
      1                  2        n            -      1        ,yet this multiplication is rather expensive, for example in terms of the area of the apparatus which needs to be provided to support such a multiplication.
All numbers of the form
  1            2      n        -    1  have a binary expansion of the form 0.000001, where the bar represents an infinitely repeating bit pattern and this example expansion is given for n=6. The size of the repeating pattern is always n bits. It is then possible to change the multiplication into a sequence of additions and shifts, becoming the sum Σa=1∞x*2−an. The sum is infinite, but clearly can be truncated to only evaluate as many iterations as are required for the target number format.
Nevertheless, there remains some complexity and expense associated with evaluating the result of the sum, which it would be desirable to reduce.